package deleteobject

import (
	"clouds.lgb24kcs.cn/controllers/files/request"
	"clouds.lgb24kcs.cn/errorx"
	"clouds.lgb24kcs.cn/services/files"
	"clouds.lgb24kcs.cn/utils"
	"github.com/gin-gonic/gin"
)

// @Summary  文件对象删除
// @Success 200 {string} string json{"code","message"}
// @Param Authorization	header string true "Bearer 31a165baebe6dec616b1f8f3207b4273"
// @Param bucket_name query string true "存储空间名称"
// @Param catalogue_name query int true "目录对象名称"
// @Param object_name query string true "文件对象名称"
// @Router /file/v1/objectdelete [delete]
// @version 1.0
func ObjectDelete(c *gin.Context) {
	req := request.ObjectDel{}
	if err := c.ShouldBindQuery(&req); err != nil {
		utils.Fail(c, errorx.ObjectDel, err.Error())
	} else {
		userId := utils.CtxUserId(c)
		files.ObjectDeleteAPI.Delete(c, req, userId)
	}
}
